package server

import (
	"context"

	"go-weixin/app/usercenter/rpc/internal/logic"
	"go-weixin/app/usercenter/rpc/internal/svc"
	"go-weixin/app/usercenter/rpc/pb/proto/usercenter"
)

type PowerServer struct {
	svcCtx *svc.ServiceContext
	usercenter.UnimplementedPowerServer
}

func NewPowerServer(svcCtx *svc.ServiceContext) *PowerServer {
	return &PowerServer{
		svcCtx: svcCtx,
	}
}
func (s *PowerServer) PowerAdd(ctx context.Context, in *usercenter.PowerAddReq) (*usercenter.PowerAddResp, error) {
	l := logic.NewPowerLogic(ctx, s.svcCtx)
	return l.PowerAdd(in)
}

func (s *PowerServer) PowerUpdate(ctx context.Context, in *usercenter.PowerUpdateReq) (*usercenter.PowerUpdateResp, error) {
	l := logic.NewPowerLogic(ctx, s.svcCtx)
	return l.PowerUpdate(in)
}

func (s *PowerServer) PowerList(ctx context.Context, in *usercenter.PowerListReq) (*usercenter.PowerListResp, error) {
	l := logic.NewPowerLogic(ctx, s.svcCtx)
	return l.PowerList(in)
}

func (s *PowerServer) PowerDetail(ctx context.Context, in *usercenter.PowerDetailReq) (*usercenter.PowerDetailResp, error) {
	l := logic.NewPowerLogic(ctx, s.svcCtx)
	return l.PowerDetail(in)
}

func (s *PowerServer) PowerGetRole(ctx context.Context, in *usercenter.PowerGetRoleReq) (*usercenter.PowerGetRoleResp, error) {
	l := logic.NewPowerLogic(ctx, s.svcCtx)
	return l.PowerGetRole(in)
}

func (s *PowerServer) PowerGetUser(ctx context.Context, in *usercenter.PowerGetUserReq) (*usercenter.PowerGetUserResp, error) {
	l := logic.NewPowerLogic(ctx, s.svcCtx)
	return l.PowerGetUser(in)
}
